from collections import namedtuple


class PropertyDict(dict):

    def __getattr__(self, item):
        return self.__getitem__(item)

    def __setattr__(self, key, value):
        self.__setitem__(key, value)

    def __delattr__(self, item):
        self.__delitem__(item)


RouteRule = namedtuple("RouteRule", "path method fn")

# 设置框架支持的方法，可以自行扩展
Methods = namedtuple("Methods", "GET POST OPTION PUT DELETE OTHER")
Methods.length = 6
